package edu.xmut.yuepaibackend;


import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;

public class ImageUtils {
    @Test
    public void test() throws IOException {
        long start = System.currentTimeMillis();
        InputStream is = new URL("https://yuepai-1308017514.cos.ap-guangzhou.myqcloud.com/default/blog-image/1.jpg")
                .openStream();
        BufferedImage sourceImg = ImageIO.read(is);
        long end = System.currentTimeMillis();
        System.out.println(end - start);
        System.out.println(sourceImg.getWidth());
        System.out.println(sourceImg.getHeight());
    }
}
